(* ::Package:: *)

(* ::Section:: *)
(*Tokenizer Tests*)


(* ::Subsection:: *)
(*Single tokenization*)


Test[CSSTokenize["url(\\)"],{CSSToken[<|"Type"->"url","String"->"\\)","Quotes"->None|>]}]


Test[CSSTokenize["url(\\"],{CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"delim","String"->"\[UnknownGlyph]"|>]}|>]}]


Test[CSSTokenize["\"a\\"],{CSSToken[<|"Type"->"string","String"->"a\\","Quotes"->"\""|>]}]


Test[CSSTokenize["\"a\\\""],{CSSToken[<|"Type"->"string","String"->"a\\","Quotes"->"\""|>]}]


Test[CSSTokenize["1.0\\"],{CSSToken[<|"Type"->"dimension","String"->"1.0","Value"->1.`,"ValueType"->"number","Unit"->"\[UnknownGlyph]"|>]}]


Test[CSSTokenize["123\\"],{CSSToken[<|"Type"->"dimension","String"->"123","Value"->123,"ValueType"->"integer","Unit"->"\[UnknownGlyph]"|>]}]


Test[CSSTokenize["#-\\"],{CSSToken[<|"Type"->"hash","String"->"-\[UnknownGlyph]","Flag"->"unrestricted"|>]}]


Test[CSSTokenize["a\\"],{CSSToken[<|"Type"->"ident","String"->"a\[UnknownGlyph]"|>]}]


Test[CSSTokenize["\\"],{CSSToken[<|"Type"->"delim","String"->"\[UnknownGlyph]"|>]}]


Test[CSSTokenize["@media print { (foo}{bar) }baz"],{CSSToken[<|"Type"->"at-keyword","String"->"media"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"print"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"{}","Children"->{CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"()","Children"->{CSSToken[<|"Type"->"ident","String"->"foo"|>],CSSToken[<|"Type"->"error","String"->"}"|>],CSSToken[<|"Type"->"{}","Children"->{CSSToken[<|"Type"->"ident","String"->"bar"|>],CSSToken[<|"Type"->"error","String"->")"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>]}|>],CSSToken[<|"Type"->"ident","String"->"baz"|>]}|>]}|>]}]


Test[CSSTokenize["a:not({href^=http\\:},  {href ^=\t'https\\:'\n}) { color: rgba(0%, 100%, 50%); }"],{CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"colon","String"->":"|>],CSSToken[<|"Type"->"function","String"->"not","Children"->{CSSToken[<|"Type"->"{}","Children"->{CSSToken[<|"Type"->"ident","String"->"href"|>],CSSToken[<|"Type"->"prefix-match","String"->"^="|>],CSSToken[<|"Type"->"ident","String"->"http\\:"|>]}|>],CSSToken[<|"Type"->"comma","String"->","|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"{}","Children"->{CSSToken[<|"Type"->"ident","String"->"href"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"prefix-match","String"->"^="|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"string","String"->"https\\:","Quotes"->"'"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>]}|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"{}","Children"->{CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"color"|>],CSSToken[<|"Type"->"colon","String"->":"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"function","String"->"rgba","Children"->{CSSToken[<|"Type"->"percentage","String"->"0","Value"->0,"ValueType"->"integer"|>],CSSToken[<|"Type"->"comma","String"->","|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"100","Value"->100,"ValueType"->"integer"|>],CSSToken[<|"Type"->"comma","String"->","|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"50","Value"->50,"ValueType"->"integer"|>]}|>],CSSToken[<|"Type"->"semicolon","String"->";"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>]}|>]}]


Test[CSSTokenize["~=|=^=$=*=||<!------> |/**/| ~/**/="],{CSSToken[<|"Type"->"include-match","String"->"~="|>],CSSToken[<|"Type"->"dash-match","String"->"|="|>],CSSToken[<|"Type"->"prefix-match","String"->"^="|>],CSSToken[<|"Type"->"suffix-match","String"->"$="|>],CSSToken[<|"Type"->"substring-match","String"->"*="|>],CSSToken[<|"Type"->"column","String"->"||"|>],CSSToken[<|"Type"->"CDO","String"->"<!--"|>],CSSToken[<|"Type"->"ident","String"->"----"|>],CSSToken[<|"Type"->"delim","String"->">"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"|"|>],CSSToken[<|"Type"->"delim","String"->"|"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"~"|>],CSSToken[<|"Type"->"delim","String"->"="|>]}]


Test[CSSTokenize["\[UGrave]+12 \[CapitalUDoubleDot]+12 u +12 U+ 12 U+12 - 20 U+1?2 U+1?-50"],{CSSToken[<|"Type"->"ident","String"->"\[UGrave]"|>],CSSToken[<|"Type"->"number","String"->"+12","Value"->12,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\[CapitalUDoubleDot]"|>],CSSToken[<|"Type"->"number","String"->"+12","Value"->12,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"u"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"+12","Value"->12,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"U"|>],CSSToken[<|"Type"->"delim","String"->"+"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"12","Value"->12,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->18,"Stop"->18|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"-"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"20","Value"->20,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->16,"Stop"->31|>],CSSToken[<|"Type"->"number","String"->"2","Value"->2,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->16,"Stop"->31|>],CSSToken[<|"Type"->"number","String"->"-50","Value"->-50,"ValueType"->"integer"|>]}]


Test[CSSTokenize["u+1-2 U+100000-2 U+1000000-2 U+10-200000"],{CSSToken[<|"Type"->"unicode-range","Start"->1,"Stop"->2|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->2|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1048576|>],CSSToken[<|"Type"->"number","String"->"0","Value"->0,"ValueType"->"integer"|>],CSSToken[<|"Type"->"number","String"->"-2","Value"->-2,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->16,"Stop"->2097152|>]}]


Test[CSSTokenize["u+?????? U+1??????"],{CSSToken[<|"Type"->"unicode-range","Start"->0,"Stop"->16777215|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->2097151|>],CSSToken[<|"Type"->"delim","String"->"?"|>]}]


Test[CSSTokenize["u+????? U+1????? U+10?????"],{CSSToken[<|"Type"->"unicode-range","Start"->0,"Stop"->1048575|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->2097151|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1114111|>],CSSToken[<|"Type"->"delim","String"->"?"|>]}]


Test[CSSTokenize["u+???? U+1???? U+10???? U+100????"],{CSSToken[<|"Type"->"unicode-range","Start"->0,"Stop"->65535|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->65536,"Stop"->131071|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1114111|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1052671|>],CSSToken[<|"Type"->"delim","String"->"?"|>]}]


Test[CSSTokenize["u+??? U+1??? U+10??? U+100??? U+1000???"],{CSSToken[<|"Type"->"unicode-range","Start"->0,"Stop"->4095|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->4096,"Stop"->8191|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->65536,"Stop"->69631|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1052671|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1048831|>],CSSToken[<|"Type"->"delim","String"->"?"|>]}]


Test[CSSTokenize["u+?? U+1?? U+10?? U+100?? U+1000?? U+10000??"],{CSSToken[<|"Type"->"unicode-range","Start"->0,"Stop"->255|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->256,"Stop"->511|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->4096,"Stop"->4351|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->65536,"Stop"->65791|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1048831|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1048591|>],CSSToken[<|"Type"->"delim","String"->"?"|>]}]


Test[CSSTokenize["u+? u+1? U+10? U+100? U+1000? U+10000? U+100000?"],{CSSToken[<|"Type"->"unicode-range","Start"->0,"Stop"->15|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->16,"Stop"->31|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->256,"Stop"->271|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->4096,"Stop"->4111|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->65536,"Stop"->65551|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1048591|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1048576|>],CSSToken[<|"Type"->"delim","String"->"?"|>]}]


Test[CSSTokenize["u+1 U+10 U+100 U+1000 U+10000 U+100000 U+1000000"],{CSSToken[<|"Type"->"unicode-range","Start"->1,"Stop"->1|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->16,"Stop"->16|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->256,"Stop"->256|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->4096,"Stop"->4096|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->65536,"Stop"->65536|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1048576|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1048576|>],CSSToken[<|"Type"->"number","String"->"0","Value"->0,"ValueType"->"integer"|>]}]


Test[CSSTokenize["12red0 12.0-red 12--red 12-\\-red 120red 12-0red 12\\u0000red 12_Red 12.red 12r\[EHat]d"],{CSSToken[<|"Type"->"dimension","String"->"12","Value"->12,"ValueType"->"integer","Unit"->"red0"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"12.0","Value"->12.`,"ValueType"->"number","Unit"->"-red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"12","Value"->12,"ValueType"->"integer","Unit"->"--red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"12","Value"->12,"ValueType"->"integer","Unit"->"-\\-red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"120","Value"->120,"ValueType"->"integer","Unit"->"red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"12","Value"->12,"ValueType"->"integer"|>],CSSToken[<|"Type"->"dimension","String"->"-0","Value"->0,"ValueType"->"integer","Unit"->"red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"12","Value"->12,"ValueType"->"integer","Unit"->"\\u0000red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"12","Value"->12,"ValueType"->"integer","Unit"->"_Red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"12","Value"->12,"ValueType"->"integer"|>],CSSToken[<|"Type"->"delim","String"->"."|>],CSSToken[<|"Type"->"ident","String"->"red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"12","Value"->12,"ValueType"->"integer","Unit"->"r\[EHat]d"|>]}]


Test[CSSTokenize["12e2px +34e+1px -45E-0px .68e+3px +.79e-1px -.01E2px 2.3E+1px +45.0e6px -0.67e0px"],{CSSToken[<|"Type"->"dimension","String"->"12e2","Value"->1200,"ValueType"->"integer","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"+34e+1","Value"->340,"ValueType"->"integer","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"-45E-0","Value"->-45,"ValueType"->"integer","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->".68e+3","Value"->680.`,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"+.79e-1","Value"->0.079`,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"-.01E2","Value"->-1.`,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"2.3E+1","Value"->23.`,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"+45.0e6","Value"->4.5`*^7,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"-0.67e0","Value"->-0.67`,"ValueType"->"number","Unit"->"px"|>]}]


Test[CSSTokenize["12px +34px -45px .67px +.89px -.01px 2.3px +45.0px -0.67px"],{CSSToken[<|"Type"->"dimension","String"->"12","Value"->12,"ValueType"->"integer","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"+34","Value"->34,"ValueType"->"integer","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"-45","Value"->-45,"ValueType"->"integer","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->".67","Value"->0.67`,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"+.89","Value"->0.89`,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"-.01","Value"->-0.01`,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"2.3","Value"->2.3`,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"+45.0","Value"->45.`,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"-0.67","Value"->-0.67`,"ValueType"->"number","Unit"->"px"|>]}]


Test[CSSTokenize["12\\% /* Percent sign can not be escaped */"],{CSSToken[<|"Type"->"dimension","String"->"12","Value"->12,"ValueType"->"integer","Unit"->"\\%"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>]}]


Test[CSSTokenize["12e2% +34e+1% -45E-0% .68e+3% +.79e-1% -.01E2% 2.3E+1% +45.0e6% -0.67e0%"],{CSSToken[<|"Type"->"percentage","String"->"12e2","Value"->1200,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"+34e+1","Value"->340,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"-45E-0","Value"->-45,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->".68e+3","Value"->680.`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"+.79e-1","Value"->0.079`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"-.01E2","Value"->-1.`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"2.3E+1","Value"->23.`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"+45.0e6","Value"->4.5`*^7,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"-0.67e0","Value"->-0.67`,"ValueType"->"number"|>]}]


Test[CSSTokenize["12% +34% -45% .67% +.89% -.01% 2.3% +45.0% -0.67%"],{CSSToken[<|"Type"->"percentage","String"->"12","Value"->12,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"+34","Value"->34,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"-45","Value"->-45,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->".67","Value"->0.67`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"+.89","Value"->0.89`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"-.01","Value"->-0.01`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"2.3","Value"->2.3`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"+45.0","Value"->45.`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"-0.67","Value"->-0.67`,"ValueType"->"number"|>]}]


Test[CSSTokenize["3e-2.1 /* Integer exponents only */"],{CSSToken[<|"Type"->"number","String"->"3e-2","Value"->0,"ValueType"->"integer"|>],CSSToken[<|"Type"->"number","String"->".1","Value"->0.1`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>]}]


Test[CSSTokenize["3\\65-2 /* Scientific notation E can not be escaped */"],{CSSToken[<|"Type"->"dimension","String"->"3","Value"->3,"ValueType"->"integer","Unit"->"\\65-2"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>]}]


Test[CSSTokenize["3. /* Decimal point must have following digits */"],{CSSToken[<|"Type"->"number","String"->"3","Value"->3,"ValueType"->"integer"|>],CSSToken[<|"Type"->"delim","String"->"."|>],CSSToken[<|"Type"->"whitespace","String"->" "|>]}]


Test[CSSTokenize["12e2 +34e+1 -45E-0 .68e+3 +.79e-1 -.01E2 2.3E+1 +45.0e6 -0.67e0"],{CSSToken[<|"Type"->"number","String"->"12e2","Value"->1200,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"+34e+1","Value"->340,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"-45E-0","Value"->-45,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->".68e+3","Value"->680.`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"+.79e-1","Value"->0.079`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"-.01E2","Value"->-1.`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"2.3E+1","Value"->23.`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"+45.0e6","Value"->4.5`*^7,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"-0.67e0","Value"->-0.67`,"ValueType"->"number"|>]}]


Test[CSSTokenize["12 +34 -45 .67 +.89 -.01 2.3 +45.0 -0.67"],{CSSToken[<|"Type"->"number","String"->"12","Value"->12,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"+34","Value"->34,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"-45","Value"->-45,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->".67","Value"->0.67`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"+.89","Value"->0.89`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"-.01","Value"->-0.01`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"2.3","Value"->2.3`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"+45.0","Value"->45.`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"-0.67","Value"->-0.67`,"ValueType"->"number"|>]}]


Test[CSSTokenize["url(\\u0001) url(\\u0002) url(\\u0003) url(\\u0004) url(\\u0005) url(\\u0006) url(\\u0007) url(\\u0008) url(\\u000b) url(\\u000e) url(\\u000f) url(\\u0010) url(\\u0011) url(\\u0012) url(\\u0013) url(\\u0014) url(\\u0015) url(\\u0016) url(\\u0017) url(\\u0018) url(\\u0019) url(\\u001a) url(\\u001b) url(\\u001c) url(\\u001d) url(\\u001e) url(\\u001f) url(\\u007f)"],{CSSToken[<|"Type"->"url","String"->"\\u0001","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0002","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0003","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0004","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0005","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0006","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0007","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0008","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u000b","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u000e","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u000f","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0010","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0011","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0012","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0013","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0014","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0015","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0016","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0017","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0018","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0019","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u001a","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u001b","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u001c","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u001d","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u001e","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u001f","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u007f","Quotes"->None|>]}]


Test[CSSTokenize["url(\\u0000!#$%&*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ{}^_`abcdefghijklmnopqrstuvwxyz{|}~\\u0080\\u0081\\u009e\\u009f\\u00a0\\u00a1\\u00a2"],{CSSToken[<|"Type"->"url","String"->"\\u0000!#$%&*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ{}^_`abcdefghijklmnopqrstuvwxyz{|}~\\u0080\\u0081\\u009e\\u009f\\u00a0\\u00a1\\u00a2","Quotes"->None|>]}]


Test[CSSTokenize["url() url( \t) url(\n Fo\[OHat]\\030\n!\n) url(\na\nb\n) url(a\\ b) url(a(b) url(a\\(b) url(a'b) url(a\\'b) url(a\"b) url(a\\\"b) url(a\nb) url(a\\\nb) url(a\\a b) url(a\\"],{CSSToken[<|"Type"->"url","String"->"","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"Fo\[OHat]\\030\n!","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>],CSSToken[<|"Type"->"ident","String"->"b"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"a\\ b","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"function","String"->"a"|>],CSSToken[<|"Type"->"ident","String"->"b"|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"a\\(b","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"error","String"->"bad-string","Children"->{CSSToken[<|"Type"->"delim","String"->"'"|>],CSSToken[<|"Type"->"ident","String"->"b"|>]}|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"a\\'b","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"error","String"->"bad-string","Children"->{CSSToken[<|"Type"->"delim","String"->"\""|>],CSSToken[<|"Type"->"ident","String"->"b"|>]}|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"a\\\"b","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>],CSSToken[<|"Type"->"ident","String"->"b"|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"ident","String"->"a\\"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>],CSSToken[<|"Type"->"ident","String"->"b"|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"a\\a b","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"ident","String"->"a\[UnknownGlyph]"|>]}|>]}]


Test[CSSTokenize["url('a\nb) url('c\n"],{CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"error","String"->"bad-string","Children"->{CSSToken[<|"Type"->"delim","String"->"'"|>],CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>]}|>],CSSToken[<|"Type"->"ident","String"->"b"|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"error","String"->"bad-string","Children"->{CSSToken[<|"Type"->"delim","String"->"'"|>],CSSToken[<|"Type"->"ident","String"->"c"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>]}|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>]}]


Test[CSSTokenize["url('a' b) url('c' d)"],{CSSToken[<|"Type"->"url","String"->"a","Quotes"->"'","Modifiers"->{CSSToken[<|"Type"->"ident","String"->"b"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"c","Quotes"->"'","Modifiers"->{CSSToken[<|"Type"->"ident","String"->"d"|>]}|>]}]


Test[CSSTokenize["URL(foo) Url(foo) \[UHat]rl(foo) url (foo) url\\ (foo) url(\t 'foo' "],{CSSToken[<|"Type"->"url","String"->"foo","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"foo","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"function","String"->"\[UHat]rl","Children"->{CSSToken[<|"Type"->"ident","String"->"foo"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"url"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"()","Children"->{CSSToken[<|"Type"->"ident","String"->"foo"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"function","String"->"url\\ ","Children"->{CSSToken[<|"Type"->"ident","String"->"foo"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"foo","Quotes"->"'"|>]}]


Test[CSSTokenize["url(\"Lo\\rem \\130 ps\\\\u m\") url('\\376\\37 6\\000376\\0000376\\"],{CSSToken[<|"Type"->"url","String"->"Lo\\rem \\130 ps\\\\u m","Quotes"->"\""|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\376\\37 6\\000376\\0000376\\","Quotes"->"'"|>]}]


Test[CSSTokenize["url(\"\") url(\"Lorem '\[IHat]psum'\"\n) url(\"a\\\nb\" ) url(\"a\nb) url(\"eof"],{CSSToken[<|"Type"->"url","String"->"","Quotes"->"\""|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"Lorem '\[IHat]psum'","Quotes"->"\""|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"a\\\nb","Quotes"->"\""|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"error","String"->"bad-string","Children"->{CSSToken[<|"Type"->"delim","String"->"\""|>],CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>]}|>],CSSToken[<|"Type"->"ident","String"->"b"|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"eof","Quotes"->"\""|>]}]


Test[CSSTokenize["url( \t"],{CSSToken[<|"Type"->"url","String"->"","Quotes"->None|>]}]


Test[CSSTokenize["url("],{CSSToken[<|"Type"->"url","String"->"","Quotes"->None|>]}]


Test[CSSTokenize["url( '') url('Lorem \"\[IHat]psum\"'\n) url('a\\\nb' ) url('a\nb) url('eof"],{CSSToken[<|"Type"->"url","String"->"","Quotes"->"'"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"Lorem \"\[IHat]psum\"","Quotes"->"'"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"a\\\nb","Quotes"->"'"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"error","String"->"bad-string","Children"->{CSSToken[<|"Type"->"delim","String"->"'"|>],CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>]}|>],CSSToken[<|"Type"->"ident","String"->"b"|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"eof","Quotes"->"'"|>]}]


Test[CSSTokenize["\"Lo\\rem \\130 ps\\\\u m\" '\\376\\37 6\\000376\\0000376\\"],{CSSToken[<|"Type"->"string","String"->"Lo\\rem \\130 ps\\\\u m","Quotes"->"\""|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"string","String"->"\\376\\37 6\\000376\\0000376\\","Quotes"->"'"|>]}]


Test[CSSTokenize["\"\" \"Lorem '\[IHat]psum'\" \"a\\\nb\" \"a\nb \"eof"],{CSSToken[<|"Type"->"string","String"->"","Quotes"->"\""|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"string","String"->"Lorem '\[IHat]psum'","Quotes"->"\""|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"string","String"->"a\\\nb","Quotes"->"\""|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-string","Children"->{CSSToken[<|"Type"->"delim","String"->"\""|>],CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>]}|>],CSSToken[<|"Type"->"ident","String"->"b"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"string","String"->"eof","Quotes"->"\""|>]}]


Test[CSSTokenize["'' 'Lorem \"\[IHat]psum\"' 'a\\\nb' 'a\nb 'eof"],{CSSToken[<|"Type"->"string","String"->"","Quotes"->"'"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"string","String"->"Lorem \"\[IHat]psum\"","Quotes"->"'"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"string","String"->"a\\\nb","Quotes"->"'"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-string","Children"->{CSSToken[<|"Type"->"delim","String"->"'"|>],CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>]}|>],CSSToken[<|"Type"->"ident","String"->"b"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"string","String"->"eof","Quotes"->"'"|>]}]


Test[CSSTokenize["p{example=\"\\\nfoo(int x) {\\\n   this.x = x;\\\n}\\\n\"}"],{CSSToken[<|"Type"->"ident","String"->"p"|>],CSSToken[<|"Type"->"{}","Children"->{CSSToken[<|"Type"->"ident","String"->"example"|>],CSSToken[<|"Type"->"delim","String"->"="|>],CSSToken[<|"Type"->"string","String"->"\\\nfoo(int x) {\\\n   this.x = x;\\\n}\\\n","Quotes"->"\""|>]}|>]}]


Test[CSSTokenize["#red0 #-Red #--red #-\\-red #0red #-0red #_Red #.red #r\[EHat]d #\[EHat]rd #\\.red\\"],{CSSToken[<|"Type"->"hash","String"->"red0","Flag"->"id"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"-Red","Flag"->"id"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"--red","Flag"->"id"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"-\\-red","Flag"->"id"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"0red","Flag"->"unrestricted"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"-0red","Flag"->"unrestricted"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"_Red","Flag"->"id"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"#"|>],CSSToken[<|"Type"->"delim","String"->"."|>],CSSToken[<|"Type"->"ident","String"->"red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"r\[EHat]d","Flag"->"id"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"\[EHat]rd","Flag"->"id"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"\\.red\[UnknownGlyph]","Flag"->"unrestricted"|>]}]


Test[CSSTokenize["@media0 @-Media @--media @-\\-media @0media @-0media @_media @.media @med\:0130a @\\30 media\\"],{CSSToken[<|"Type"->"at-keyword","String"->"media0"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"at-keyword","String"->"-Media"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"at-keyword","String"->"--media"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"at-keyword","String"->"-\\-media"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"@"|>],CSSToken[<|"Type"->"dimension","String"->"0","Value"->0,"ValueType"->"integer","Unit"->"media"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"@"|>],CSSToken[<|"Type"->"dimension","String"->"-0","Value"->0,"ValueType"->"integer","Unit"->"media"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"at-keyword","String"->"_media"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"@"|>],CSSToken[<|"Type"->"delim","String"->"."|>],CSSToken[<|"Type"->"ident","String"->"media"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"at-keyword","String"->"med\:0130a"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"at-keyword","String"->"\\30 media\[UnknownGlyph]"|>]}]


Test[CSSTokenize["rgba0() -rgba() --rgba() -\\-rgba() 0rgba() -0rgba() _rgba() .rgba() rgb\[AHat]() \\30rgba() rgba () @rgba() #rgba()"],{CSSToken[<|"Type"->"function","String"->"rgba0","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"function","String"->"-rgba","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"function","String"->"--rgba","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"function","String"->"-\\-rgba","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"0","Value"->0,"ValueType"->"integer","Unit"->"rgba"|>],CSSToken[<|"Type"->"()","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"-0","Value"->0,"ValueType"->"integer","Unit"->"rgba"|>],CSSToken[<|"Type"->"()","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"function","String"->"_rgba","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"."|>],CSSToken[<|"Type"->"function","String"->"rgba","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"function","String"->"rgb\[AHat]","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"function","String"->"\\30rgba","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"rgba"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"()","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"at-keyword","String"->"rgba"|>],CSSToken[<|"Type"->"()","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"rgba","Flag"->"id"|>],CSSToken[<|"Type"->"()","Children"->{}|>]}]


Test[CSSTokenize["\\30red \\00030 red \\30\r\nred \\0000000red \\1100000red \\red \\r ed \\.red \\ red \\\nred \\376\\37 6\\000376\\0000376\\"],{CSSToken[<|"Type"->"ident","String"->"\\30red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\\00030 red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\\30\r\nred"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\[UnknownGlyph]0red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\[UnknownGlyph]0red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\\red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\\r"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"ed"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\\.red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\\ red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"\\"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\\376\\37 6\\000376\\0000376\[UnknownGlyph]"|>]}]


Test[CSSTokenize["\\- red0 -red --red -\\-red\\ blue 0red -0red \\u0000red _Red .red r\[EHat]d r\\\[EHat]d \\u007F\\u0080\\u0081"],{CSSToken[<|"Type"->"ident","String"->"\\-"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"red0"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"-red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"--red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"-\\-red\\ blue"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"0","Value"->0,"ValueType"->"integer","Unit"->"red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"-0","Value"->0,"ValueType"->"integer","Unit"->"red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\\u0000red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"_Red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"."|>],CSSToken[<|"Type"->"ident","String"->"red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"r\[EHat]d"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"r\\\[EHat]d"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\\u007F\\u0080\\u0081"|>]}]


Test[CSSTokenize["red-->/* Not CDC */"],{CSSToken[<|"Type"->"ident","String"->"red--"|>],CSSToken[<|"Type"->"delim","String"->">"|>]}]


Test[CSSTokenize["red/* CDC */-->"],{CSSToken[<|"Type"->"ident","String"->"red"|>],CSSToken[<|"Type"->"CDC","String"->"-->"|>]}]


Test[CSSTokenize["  \t\t\r\n\nRed "],{CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"Red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>]}]


Test[CSSTokenize["red"],{CSSToken[<|"Type"->"ident","String"->"red"|>]}]


Test[CSSTokenize["/*/*///** /* **/*//* "],{CSSToken[<|"Type"->"delim","String"->"/"|>],CSSToken[<|"Type"->"delim","String"->"*"|>],CSSToken[<|"Type"->"delim","String"->"/"|>],CSSToken[<|"Type"->"delim","String"->"/"|>],CSSToken[<|"Type"->"delim","String"->"*"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>]}]


Test[CSSTokenize[""],{}]


(* ::Subsection:: *)
(*Tokenize round-trip*)


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["url(\\)"]]]]],{CSSToken[<|"Type"->"url","String"->"\\)","Quotes"->None|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["url(\\"]]]]],{CSSToken[<|"Type"->"url","String"->"\[UnknownGlyph]","Quotes"->None|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["\"a\\"]]]]],{CSSToken[<|"Type"->"string","String"->"a\\","Quotes"->"\""|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["\"a\\\""]]]]],{CSSToken[<|"Type"->"string","String"->"a\\","Quotes"->"\""|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["1.0\\"]]]]],{CSSToken[<|"Type"->"dimension","String"->"1.0","Value"->1.`,"ValueType"->"number","Unit"->"\[UnknownGlyph]"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["123\\"]]]]],{CSSToken[<|"Type"->"dimension","String"->"123","Value"->123,"ValueType"->"integer","Unit"->"\[UnknownGlyph]"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["#-\\"]]]]],{CSSToken[<|"Type"->"hash","String"->"-\[UnknownGlyph]","Flag"->"id"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["a\\"]]]]],{CSSToken[<|"Type"->"ident","String"->"a\[UnknownGlyph]"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["\\"]]]]],{CSSToken[<|"Type"->"ident","String"->"\[UnknownGlyph]"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["@media print { (foo}{bar) }baz"]]]]],{CSSToken[<|"Type"->"at-keyword","String"->"media"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"print"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"{}","Children"->{CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"()","Children"->{CSSToken[<|"Type"->"ident","String"->"foo"|>],CSSToken[<|"Type"->"error","String"->"}"|>],CSSToken[<|"Type"->"{}","Children"->{CSSToken[<|"Type"->"ident","String"->"bar"|>],CSSToken[<|"Type"->"error","String"->")"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>]}|>],CSSToken[<|"Type"->"ident","String"->"baz"|>]}|>]}|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["a:not({href^=http\\:},  {href ^=\t'https\\:'\n}) { color: rgba(0%, 100%, 50%); }"]]]]],{CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"colon","String"->":"|>],CSSToken[<|"Type"->"function","String"->"not","Children"->{CSSToken[<|"Type"->"{}","Children"->{CSSToken[<|"Type"->"ident","String"->"href"|>],CSSToken[<|"Type"->"prefix-match","String"->"^="|>],CSSToken[<|"Type"->"ident","String"->"http\\:"|>]}|>],CSSToken[<|"Type"->"comma","String"->","|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"{}","Children"->{CSSToken[<|"Type"->"ident","String"->"href"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"prefix-match","String"->"^="|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"string","String"->"https\\:","Quotes"->"'"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>]}|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"{}","Children"->{CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"color"|>],CSSToken[<|"Type"->"colon","String"->":"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"function","String"->"rgba","Children"->{CSSToken[<|"Type"->"percentage","String"->"0","Value"->0,"ValueType"->"integer"|>],CSSToken[<|"Type"->"comma","String"->","|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"100","Value"->100,"ValueType"->"integer"|>],CSSToken[<|"Type"->"comma","String"->","|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"50","Value"->50,"ValueType"->"integer"|>]}|>],CSSToken[<|"Type"->"semicolon","String"->";"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>]}|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["~=|=^=$=*=||<!------> |/**/| ~/**/="]]]]],{CSSToken[<|"Type"->"include-match","String"->"~="|>],CSSToken[<|"Type"->"dash-match","String"->"|="|>],CSSToken[<|"Type"->"prefix-match","String"->"^="|>],CSSToken[<|"Type"->"suffix-match","String"->"$="|>],CSSToken[<|"Type"->"substring-match","String"->"*="|>],CSSToken[<|"Type"->"column","String"->"||"|>],CSSToken[<|"Type"->"CDO","String"->"<!--"|>],CSSToken[<|"Type"->"ident","String"->"----"|>],CSSToken[<|"Type"->"delim","String"->">"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"|"|>],CSSToken[<|"Type"->"delim","String"->"|"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"~"|>],CSSToken[<|"Type"->"delim","String"->"="|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["\[UGrave]+12 \[CapitalUDoubleDot]+12 u +12 U+ 12 U+12 - 20 U+1?2 U+1?-50"]]]]],{CSSToken[<|"Type"->"ident","String"->"\[UGrave]"|>],CSSToken[<|"Type"->"number","String"->"+12","Value"->12,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\[CapitalUDoubleDot]"|>],CSSToken[<|"Type"->"number","String"->"+12","Value"->12,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"u"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"+12","Value"->12,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"U"|>],CSSToken[<|"Type"->"delim","String"->"+"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"12","Value"->12,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->18,"Stop"->18|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"-"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"20","Value"->20,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->16,"Stop"->31|>],CSSToken[<|"Type"->"number","String"->"2","Value"->2,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->16,"Stop"->31|>],CSSToken[<|"Type"->"number","String"->"-50","Value"->-50,"ValueType"->"integer"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["u+1-2 U+100000-2 U+1000000-2 U+10-200000"]]]]],{CSSToken[<|"Type"->"unicode-range","Start"->1,"Stop"->2|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->2|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1048576|>],CSSToken[<|"Type"->"number","String"->"0","Value"->0,"ValueType"->"integer"|>],CSSToken[<|"Type"->"number","String"->"-2","Value"->-2,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->16,"Stop"->2097152|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["u+?????? U+1??????"]]]]],{CSSToken[<|"Type"->"unicode-range","Start"->0,"Stop"->16777215|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->2097151|>],CSSToken[<|"Type"->"delim","String"->"?"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["u+????? U+1????? U+10?????"]]]]],{CSSToken[<|"Type"->"unicode-range","Start"->0,"Stop"->1048575|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->2097151|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1114111|>],CSSToken[<|"Type"->"delim","String"->"?"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["u+???? U+1???? U+10???? U+100????"]]]]],{CSSToken[<|"Type"->"unicode-range","Start"->0,"Stop"->65535|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->65536,"Stop"->131071|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1114111|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1052671|>],CSSToken[<|"Type"->"delim","String"->"?"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["u+??? U+1??? U+10??? U+100??? U+1000???"]]]]],{CSSToken[<|"Type"->"unicode-range","Start"->0,"Stop"->4095|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->4096,"Stop"->8191|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->65536,"Stop"->69631|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1052671|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1048831|>],CSSToken[<|"Type"->"delim","String"->"?"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["u+?? U+1?? U+10?? U+100?? U+1000?? U+10000??"]]]]],{CSSToken[<|"Type"->"unicode-range","Start"->0,"Stop"->255|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->256,"Stop"->511|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->4096,"Stop"->4351|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->65536,"Stop"->65791|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1048831|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1048591|>],CSSToken[<|"Type"->"delim","String"->"?"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["u+? u+1? U+10? U+100? U+1000? U+10000? U+100000?"]]]]],{CSSToken[<|"Type"->"unicode-range","Start"->0,"Stop"->15|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->16,"Stop"->31|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->256,"Stop"->271|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->4096,"Stop"->4111|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->65536,"Stop"->65551|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1048591|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1048576|>],CSSToken[<|"Type"->"delim","String"->"?"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["u+1 U+10 U+100 U+1000 U+10000 U+100000 U+1000000"]]]]],{CSSToken[<|"Type"->"unicode-range","Start"->1,"Stop"->1|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->16,"Stop"->16|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->256,"Stop"->256|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->4096,"Stop"->4096|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->65536,"Stop"->65536|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1048576|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"unicode-range","Start"->1048576,"Stop"->1048576|>],CSSToken[<|"Type"->"number","String"->"0","Value"->0,"ValueType"->"integer"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["12red0 12.0-red 12--red 12-\\-red 120red 12-0red 12\\u0000red 12_Red 12.red 12r\[EHat]d"]]]]],{CSSToken[<|"Type"->"dimension","String"->"12","Value"->12,"ValueType"->"integer","Unit"->"red0"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"12.0","Value"->12.`,"ValueType"->"number","Unit"->"-red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"12","Value"->12,"ValueType"->"integer","Unit"->"--red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"12","Value"->12,"ValueType"->"integer","Unit"->"-\\-red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"120","Value"->120,"ValueType"->"integer","Unit"->"red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"12","Value"->12,"ValueType"->"integer"|>],CSSToken[<|"Type"->"dimension","String"->"-0","Value"->0,"ValueType"->"integer","Unit"->"red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"12","Value"->12,"ValueType"->"integer","Unit"->"\\u0000red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"12","Value"->12,"ValueType"->"integer","Unit"->"_Red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"12","Value"->12,"ValueType"->"integer"|>],CSSToken[<|"Type"->"delim","String"->"."|>],CSSToken[<|"Type"->"ident","String"->"red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"12","Value"->12,"ValueType"->"integer","Unit"->"r\[EHat]d"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["12e2px +34e+1px -45E-0px .68e+3px +.79e-1px -.01E2px 2.3E+1px +45.0e6px -0.67e0px"]]]]],{CSSToken[<|"Type"->"dimension","String"->"12e2","Value"->1200,"ValueType"->"integer","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"+34e+1","Value"->340,"ValueType"->"integer","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"-45E-0","Value"->-45,"ValueType"->"integer","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->".68e+3","Value"->680.`,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"+.79e-1","Value"->0.079`,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"-.01E2","Value"->-1.`,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"2.3E+1","Value"->23.`,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"+45.0e6","Value"->4.5`*^7,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"-0.67e0","Value"->-0.67`,"ValueType"->"number","Unit"->"px"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["12px +34px -45px .67px +.89px -.01px 2.3px +45.0px -0.67px"]]]]],{CSSToken[<|"Type"->"dimension","String"->"12","Value"->12,"ValueType"->"integer","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"+34","Value"->34,"ValueType"->"integer","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"-45","Value"->-45,"ValueType"->"integer","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->".67","Value"->0.67`,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"+.89","Value"->0.89`,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"-.01","Value"->-0.01`,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"2.3","Value"->2.3`,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"+45.0","Value"->45.`,"ValueType"->"number","Unit"->"px"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"-0.67","Value"->-0.67`,"ValueType"->"number","Unit"->"px"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["12\\% /* Percent sign can not be escaped */"]]]]],{CSSToken[<|"Type"->"dimension","String"->"12","Value"->12,"ValueType"->"integer","Unit"->"\\%"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["12e2% +34e+1% -45E-0% .68e+3% +.79e-1% -.01E2% 2.3E+1% +45.0e6% -0.67e0%"]]]]],{CSSToken[<|"Type"->"percentage","String"->"12e2","Value"->1200,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"+34e+1","Value"->340,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"-45E-0","Value"->-45,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->".68e+3","Value"->680.`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"+.79e-1","Value"->0.079`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"-.01E2","Value"->-1.`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"2.3E+1","Value"->23.`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"+45.0e6","Value"->4.5`*^7,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"-0.67e0","Value"->-0.67`,"ValueType"->"number"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["12% +34% -45% .67% +.89% -.01% 2.3% +45.0% -0.67%"]]]]],{CSSToken[<|"Type"->"percentage","String"->"12","Value"->12,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"+34","Value"->34,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"-45","Value"->-45,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->".67","Value"->0.67`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"+.89","Value"->0.89`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"-.01","Value"->-0.01`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"2.3","Value"->2.3`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"+45.0","Value"->45.`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"percentage","String"->"-0.67","Value"->-0.67`,"ValueType"->"number"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["3e-2.1 /* Integer exponents only */"]]]]],{CSSToken[<|"Type"->"number","String"->"3e-2","Value"->0,"ValueType"->"integer"|>],CSSToken[<|"Type"->"number","String"->".1","Value"->0.1`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["3\\65-2 /* Scientific notation E can not be escaped */"]]]]],{CSSToken[<|"Type"->"dimension","String"->"3","Value"->3,"ValueType"->"integer","Unit"->"\\65-2"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["3. /* Decimal point must have following digits */"]]]]],{CSSToken[<|"Type"->"number","String"->"3","Value"->3,"ValueType"->"integer"|>],CSSToken[<|"Type"->"delim","String"->"."|>],CSSToken[<|"Type"->"whitespace","String"->" "|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["12e2 +34e+1 -45E-0 .68e+3 +.79e-1 -.01E2 2.3E+1 +45.0e6 -0.67e0"]]]]],{CSSToken[<|"Type"->"number","String"->"12e2","Value"->1200,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"+34e+1","Value"->340,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"-45E-0","Value"->-45,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->".68e+3","Value"->680.`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"+.79e-1","Value"->0.079`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"-.01E2","Value"->-1.`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"2.3E+1","Value"->23.`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"+45.0e6","Value"->4.5`*^7,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"-0.67e0","Value"->-0.67`,"ValueType"->"number"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["12 +34 -45 .67 +.89 -.01 2.3 +45.0 -0.67"]]]]],{CSSToken[<|"Type"->"number","String"->"12","Value"->12,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"+34","Value"->34,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"-45","Value"->-45,"ValueType"->"integer"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->".67","Value"->0.67`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"+.89","Value"->0.89`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"-.01","Value"->-0.01`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"2.3","Value"->2.3`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"+45.0","Value"->45.`,"ValueType"->"number"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"number","String"->"-0.67","Value"->-0.67`,"ValueType"->"number"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["url(\\u0001) url(\\u0002) url(\\u0003) url(\\u0004) url(\\u0005) url(\\u0006) url(\\u0007) url(\\u0008) url(\\u000b) url(\\u000e) url(\\u000f) url(\\u0010) url(\\u0011) url(\\u0012) url(\\u0013) url(\\u0014) url(\\u0015) url(\\u0016) url(\\u0017) url(\\u0018) url(\\u0019) url(\\u001a) url(\\u001b) url(\\u001c) url(\\u001d) url(\\u001e) url(\\u001f) url(\\u007f)"]]]]],{CSSToken[<|"Type"->"url","String"->"\\u0001","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0002","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0003","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0004","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0005","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0006","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0007","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0008","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u000b","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u000e","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u000f","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0010","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0011","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0012","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0013","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0014","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0015","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0016","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0017","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0018","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u0019","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u001a","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u001b","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u001c","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u001d","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u001e","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u001f","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\u007f","Quotes"->None|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["url(\\u0000!#$%&*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ{}^_`abcdefghijklmnopqrstuvwxyz{|}~\\u0080\\u0081\\u009e\\u009f\\u00a0\\u00a1\\u00a2"]]]]],{CSSToken[<|"Type"->"url","String"->"\\u0000!#$%&*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ{}^_`abcdefghijklmnopqrstuvwxyz{|}~\\u0080\\u0081\\u009e\\u009f\\u00a0\\u00a1\\u00a2","Quotes"->None|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["url() url( \t) url(\n Fo\[OHat]\\030\n!\n) url(\na\nb\n) url(a\\ b) url(a(b) url(a\\(b) url(a'b) url(a\\'b) url(a\"b) url(a\\\"b) url(a\nb) url(a\\\nb) url(a\\a b) url(a\\"]]]]],{CSSToken[<|"Type"->"url","String"->"","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"Fo\[OHat]\\030\n!","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>],CSSToken[<|"Type"->"ident","String"->"b"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"a\\ b","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"function","String"->"a"|>],CSSToken[<|"Type"->"ident","String"->"b"|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"a\\(b","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"error","String"->"bad-string","Children"->{CSSToken[<|"Type"->"delim","String"->"'"|>],CSSToken[<|"Type"->"ident","String"->"b"|>]}|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"a\\'b","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"error","String"->"bad-string","Children"->{CSSToken[<|"Type"->"delim","String"->"\""|>],CSSToken[<|"Type"->"ident","String"->"b"|>]}|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"a\\\"b","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>],CSSToken[<|"Type"->"ident","String"->"b"|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"ident","String"->"a\\"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>],CSSToken[<|"Type"->"ident","String"->"b"|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"a\\a b","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"a\[UnknownGlyph]","Quotes"->None|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["url('a\nb) url('c\n"]]]]],{CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"error","String"->"bad-string","Children"->{CSSToken[<|"Type"->"delim","String"->"'"|>],CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>]}|>],CSSToken[<|"Type"->"ident","String"->"b"|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"urlhead","String"->"url("|>],CSSToken[<|"Type"->"error","String"->"bad-string","Children"->{CSSToken[<|"Type"->"delim","String"->"'"|>],CSSToken[<|"Type"->"ident","String"->"c"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>]}|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"error","String"->")"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["url('a' b) url('c' d)"]]]]],{CSSToken[<|"Type"->"url","String"->"a","Quotes"->"'"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"c","Quotes"->"'"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["URL(foo) Url(foo) \[UHat]rl(foo) url (foo) url\\ (foo) url(\t 'foo' "]]]]],{CSSToken[<|"Type"->"url","String"->"foo","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"foo","Quotes"->None|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"function","String"->"\[UHat]rl","Children"->{CSSToken[<|"Type"->"ident","String"->"foo"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"url"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"()","Children"->{CSSToken[<|"Type"->"ident","String"->"foo"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"function","String"->"url\\ ","Children"->{CSSToken[<|"Type"->"ident","String"->"foo"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"foo","Quotes"->"'"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["url(\"Lo\\rem \\130 ps\\\\u m\") url('\\376\\37 6\\000376\\0000376\\"]]]]],{CSSToken[<|"Type"->"url","String"->"Lo\\rem \\130 ps\\\\u m","Quotes"->"\""|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"\\376\\37 6\\000376\\0000376\[UnknownGlyph]","Quotes"->"'"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["url(\"\") url(\"Lorem '\[IHat]psum'\"\n) url(\"a\\\nb\" ) url(\"a\nb) url(\"eof"]]]]],{CSSToken[<|"Type"->"url","String"->"","Quotes"->"\""|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"Lorem '\[IHat]psum'","Quotes"->"\""|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"a\\\nb","Quotes"->"\""|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"error","String"->"bad-string","Children"->{CSSToken[<|"Type"->"delim","String"->"\""|>],CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>]}|>],CSSToken[<|"Type"->"ident","String"->"b"|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"eof","Quotes"->"\""|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["url( \t"]]]]],{CSSToken[<|"Type"->"url","String"->"","Quotes"->None|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["url("]]]]],{CSSToken[<|"Type"->"url","String"->"","Quotes"->None|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["url( '') url('Lorem \"\[IHat]psum\"'\n) url('a\\\nb' ) url('a\nb) url('eof"]]]]],{CSSToken[<|"Type"->"url","String"->"","Quotes"->"'"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"Lorem \"\[IHat]psum\"","Quotes"->"'"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"a\\\nb","Quotes"->"'"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-url","Children"->{CSSToken[<|"Type"->"error","String"->"bad-string","Children"->{CSSToken[<|"Type"->"delim","String"->"'"|>],CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>]}|>],CSSToken[<|"Type"->"ident","String"->"b"|>],CSSToken[<|"Type"->"delim","String"->")"|>]}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"url","String"->"eof","Quotes"->"'"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["\"Lo\\rem \\130 ps\\\\u m\" '\\376\\37 6\\000376\\0000376\\"]]]]],{CSSToken[<|"Type"->"string","String"->"Lo\\rem \\130 ps\\\\u m","Quotes"->"\""|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"string","String"->"\\376\\37 6\\000376\\0000376\\","Quotes"->"'"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["\"\" \"Lorem '\[IHat]psum'\" \"a\\\nb\" \"a\nb \"eof"]]]]],{CSSToken[<|"Type"->"string","String"->"","Quotes"->"\""|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"string","String"->"Lorem '\[IHat]psum'","Quotes"->"\""|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"string","String"->"a\\\nb","Quotes"->"\""|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-string","Children"->{CSSToken[<|"Type"->"delim","String"->"\""|>],CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>]}|>],CSSToken[<|"Type"->"ident","String"->"b"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"string","String"->"eof","Quotes"->"\""|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["'' 'Lorem \"\[IHat]psum\"' 'a\\\nb' 'a\nb 'eof"]]]]],{CSSToken[<|"Type"->"string","String"->"","Quotes"->"'"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"string","String"->"Lorem \"\[IHat]psum\"","Quotes"->"'"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"string","String"->"a\\\nb","Quotes"->"'"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"error","String"->"bad-string","Children"->{CSSToken[<|"Type"->"delim","String"->"'"|>],CSSToken[<|"Type"->"ident","String"->"a"|>],CSSToken[<|"Type"->"newline","String"->"\n"|>]}|>],CSSToken[<|"Type"->"ident","String"->"b"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"string","String"->"eof","Quotes"->"'"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["p{example=\"\\\nfoo(int x) {\\\n   this.x = x;\\\n}\\\n\"}"]]]]],{CSSToken[<|"Type"->"ident","String"->"p"|>],CSSToken[<|"Type"->"{}","Children"->{CSSToken[<|"Type"->"ident","String"->"example"|>],CSSToken[<|"Type"->"delim","String"->"="|>],CSSToken[<|"Type"->"string","String"->"\\\nfoo(int x) {\\\n   this.x = x;\\\n}\\\n","Quotes"->"\""|>]}|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["#red0 #-Red #--red #-\\-red #0red #-0red #_Red #.red #r\[EHat]d #\[EHat]rd #\\.red\\"]]]]],{CSSToken[<|"Type"->"hash","String"->"red0","Flag"->"id"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"-Red","Flag"->"id"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"--red","Flag"->"id"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"-\\-red","Flag"->"id"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"0red","Flag"->"unrestricted"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"-0red","Flag"->"unrestricted"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"_Red","Flag"->"id"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"#"|>],CSSToken[<|"Type"->"delim","String"->"."|>],CSSToken[<|"Type"->"ident","String"->"red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"r\[EHat]d","Flag"->"id"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"\[EHat]rd","Flag"->"id"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"\\.red\[UnknownGlyph]","Flag"->"id"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["@media0 @-Media @--media @-\\-media @0media @-0media @_media @.media @med\:0130a @\\30 media\\"]]]]],{CSSToken[<|"Type"->"at-keyword","String"->"media0"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"at-keyword","String"->"-Media"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"at-keyword","String"->"--media"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"at-keyword","String"->"-\\-media"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"@"|>],CSSToken[<|"Type"->"dimension","String"->"0","Value"->0,"ValueType"->"integer","Unit"->"media"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"@"|>],CSSToken[<|"Type"->"dimension","String"->"-0","Value"->0,"ValueType"->"integer","Unit"->"media"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"at-keyword","String"->"_media"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"@"|>],CSSToken[<|"Type"->"delim","String"->"."|>],CSSToken[<|"Type"->"ident","String"->"media"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"at-keyword","String"->"med\:0130a"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"at-keyword","String"->"\\30 media\[UnknownGlyph]"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["rgba0() -rgba() --rgba() -\\-rgba() 0rgba() -0rgba() _rgba() .rgba() rgb\[AHat]() \\30rgba() rgba () @rgba() #rgba()"]]]]],{CSSToken[<|"Type"->"function","String"->"rgba0","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"function","String"->"-rgba","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"function","String"->"--rgba","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"function","String"->"-\\-rgba","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"0","Value"->0,"ValueType"->"integer","Unit"->"rgba"|>],CSSToken[<|"Type"->"()","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"-0","Value"->0,"ValueType"->"integer","Unit"->"rgba"|>],CSSToken[<|"Type"->"()","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"function","String"->"_rgba","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"."|>],CSSToken[<|"Type"->"function","String"->"rgba","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"function","String"->"rgb\[AHat]","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"function","String"->"\\30rgba","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"rgba"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"()","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"at-keyword","String"->"rgba"|>],CSSToken[<|"Type"->"()","Children"->{}|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"hash","String"->"rgba","Flag"->"id"|>],CSSToken[<|"Type"->"()","Children"->{}|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["\\30red \\00030 red \\30\r\nred \\0000000red \\1100000red \\red \\r ed \\.red \\ red \\\nred \\376\\37 6\\000376\\0000376\\"]]]]],{CSSToken[<|"Type"->"ident","String"->"\\30red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\\00030 red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\\30\r\nred"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\[UnknownGlyph]0red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\[UnknownGlyph]0red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\\red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\\r"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"ed"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\\.red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\\ red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"\\"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\\376\\37 6\\000376\\0000376\[UnknownGlyph]"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["\\- red0 -red --red -\\-red\\ blue 0red -0red \\u0000red _Red .red r\[EHat]d r\\\[EHat]d \\u007F\\u0080\\u0081"]]]]],{CSSToken[<|"Type"->"ident","String"->"\\-"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"red0"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"-red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"--red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"-\\-red\\ blue"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"0","Value"->0,"ValueType"->"integer","Unit"->"red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"dimension","String"->"-0","Value"->0,"ValueType"->"integer","Unit"->"red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\\u0000red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"_Red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"delim","String"->"."|>],CSSToken[<|"Type"->"ident","String"->"red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"r\[EHat]d"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"r\\\[EHat]d"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"\\u007F\\u0080\\u0081"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["red-->/* Not CDC */"]]]]],{CSSToken[<|"Type"->"ident","String"->"red--"|>],CSSToken[<|"Type"->"delim","String"->">"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["red/* CDC */-->"]]]]],{CSSToken[<|"Type"->"ident","String"->"red"|>],CSSToken[<|"Type"->"CDC","String"->"-->"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["  \t\t\r\n\nRed "]]]]],{CSSToken[<|"Type"->"whitespace","String"->" "|>],CSSToken[<|"Type"->"ident","String"->"Red"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["red"]]]]],{CSSToken[<|"Type"->"ident","String"->"red"|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize["/*/*///** /* **/*//* "]]]]],{CSSToken[<|"Type"->"delim","String"->"/"|>],CSSToken[<|"Type"->"delim","String"->"*"|>],CSSToken[<|"Type"->"delim","String"->"/"|>],CSSToken[<|"Type"->"delim","String"->"/"|>],CSSToken[<|"Type"->"delim","String"->"*"|>],CSSToken[<|"Type"->"whitespace","String"->" "|>]}]


Test[CSSTokenize[CSSUntokenize[CSSTokenize[CSSUntokenize[CSSTokenize[""]]]]],{}]
